org.eclipse.vtp.framework.engine
Class ServiceDescriptor

java.lang.Object
  extended by org.eclipse.vtp.framework.engine.ServiceDescriptor

public final class ServiceDescriptor
extends java.lang.Object

An object that describes a service made available to actions.

Author:
Lonnie Pryor

Field Summary
static java.lang.String SCOPE_ACTION
          The constant representing the action-specific scope.
static java.lang.String SCOPE_EXECUTION
          The constant representing the execution-specific scope.
static java.lang.String SCOPE_PROCESS
          The constant representing the process-wide scope.
static java.lang.String SCOPE_SESSION
          The constant representing the session-specific scope.
 
Constructor Summary
ServiceDescriptor(java.lang.String id, java.lang.String name, java.lang.String scope, java.lang.Class type, IdentifierDescriptor[] identifiers)
          Creates a new ServiceDescriptor.
 
Method Summary
 java.lang.String getId()
          Returns the ID of this service.
 IdentifierDescriptor getIdentifier(int index)
          Returns the identifiers at the specified index.
 int getIdentifierCount()
          Returns the number of identifiers declared on this service.
 java.lang.String getName()
          Returns the name of this service.
 java.lang.String getScope()
          Returns the scope this service is registered at.
 java.lang.Class getType()
          Returns the type of this service.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SCOPE_PROCESS

public static final java.lang.String SCOPE_PROCESS
The constant representing the process-wide scope.

See Also:
Constant Field Values

SCOPE_SESSION

public static final java.lang.String SCOPE_SESSION
The constant representing the session-specific scope.

See Also:
Constant Field Values

SCOPE_EXECUTION

public static final java.lang.String SCOPE_EXECUTION
The constant representing the execution-specific scope.

See Also:
Constant Field Values

SCOPE_ACTION

public static final java.lang.String SCOPE_ACTION
The constant representing the action-specific scope.

See Also:
Constant Field Values
Constructor Detail

ServiceDescriptor

public ServiceDescriptor(java.lang.String id,
                         java.lang.String name,
                         java.lang.String scope,
                         java.lang.Class type,
                         IdentifierDescriptor[] identifiers)
                  throws java.lang.IllegalArgumentException,
                         java.lang.NullPointerException
Creates a new ServiceDescriptor.

Parameters:
id - The ID of this service.
name - The name of this service.
scope - The scope this service is registered at.
type - The type of this service.
identifiers - The identifiers to register the service under.
Throws:
java.lang.IllegalArgumentException - If the supplied ID is empty.
java.lang.IllegalArgumentException - If the supplied name is empty.
java.lang.IllegalArgumentException - If the supplied scope is not one of application, session, execution, or action.
java.lang.IllegalArgumentException - If the supplied type is not a public, concrete class with at least one public constructor.
java.lang.IllegalArgumentException - If the same identifier name is listed more than once in the supplied identifier array.
java.lang.NullPointerException - If the supplied ID is null.
java.lang.NullPointerException - If the supplied name is null.
java.lang.NullPointerException - If the supplied scope is null.
java.lang.NullPointerException - If the supplied type is null.
java.lang.NullPointerException - If the supplied identifier array or any of its elements are null.
Method Detail

getId

public java.lang.String getId()
Returns the ID of this service.

Returns:
The ID of this service.

getName

public java.lang.String getName()
Returns the name of this service.

Returns:
The name of this service.

getScope

public java.lang.String getScope()
Returns the scope this service is registered at.

Returns:
The scope this service is registered at.

getType

public java.lang.Class getType()
Returns the type of this service.

Returns:
The type of this service.

getIdentifierCount

public int getIdentifierCount()
Returns the number of identifiers declared on this service.

Returns:
The number of identifiers declared on this service.

getIdentifier

public IdentifierDescriptor getIdentifier(int index)
                                   throws java.lang.IndexOutOfBoundsException
Returns the identifiers at the specified index.

Returns:
The qualifier at the specified index.
Throws:
java.lang.IndexOutOfBoundsException - If the supplied index is less than zero or greater than or equal to this service's identifiers count.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object